package com.code.wflow.constants;

/**
 * @author ggh
 * @date 2022/11/13
 * 节点详情的状态
 */
public enum HandleTaskStatusEnum {
    NO_EXECUTE((byte) 0, "未执行"),
    AGREE((byte) 1, "同意"),
    REFUSE((byte) 2, "拒绝"),
    READED((byte) 3, "已读");

    HandleTaskStatusEnum(Byte type, String msg) {
        this.type = type;
        this.msg = msg;
    }

    private static HandleTaskStatusEnum[] taskStatusEnums = {AGREE, REFUSE};

    private Byte type;

    private String msg;

    public String getMsg() {
        return msg;
    }

    public Byte getType() {
        return type;
    }

    public static boolean handlerTask(Byte type) {
        for (HandleTaskStatusEnum taskEnum : taskStatusEnums) {
            if (taskEnum.getType().equals(type)) {
                return true;
            }
        }
        return false;
    }
}
